<template>
	<div class="sys-org-container">
		<el-dialog v-model="state.isShowDialog" draggable :close-on-click-modal="false" :style="{ 'height': '500px' }">
            <template #header>
                <div style="color: #fff">
                    <el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit />
                    </el-icon>
                    <span> {{ props.title }} </span>
                </div>
            </template>
            <el-table :data="state.materielWorkBins" :header-cell-style="{
                background: 'var(--el-color-primary)',
                height: '25px', color: '#fff', border: '1px solid #fff', fontWeight: 'bold', fontSize: '13px'
            }" height="353">
						<el-table-column label="料号" prop="materielNum" align="center" show-overflow-tooltip/>
						<!-- <el-table-column label="物料名" prop="materielName" align="center" show-overflow-tooltip/> -->

						 <el-table-column label="规格型号" prop="productionLot" align="center" show-overflow-tooltip/>
						 <el-table-column label="出入库数量" prop="productCount" align="center" show-overflow-tooltip/> 
						 <!-- <el-table-column label="料箱编号" prop="workBinNum" align="center" show-overflow-tooltip/> -->
						 <!-- <el-table-column label="进出类型" prop="" align="center" show-overflow-tooltip/>  -->

						<!-- <el-table-column label="出入库区域" align="center" show-overflow-tooltip>
							<template #default="scope">
								<div>
									{{scope.row.whName}}——{{scope.row.regionName}}
								</div>
							</template>
						</el-table-column> -->

						<!-- <el-table-column label="出入库库位" prop="storageName" align="center" show-overflow-tooltip/> -->
						<el-table-column label="出入库时间" prop="productionDate" align="center" show-overflow-tooltip/>

						<!-- <el-table-column label="操作人" prop="User" align="center" show-overflow-tooltip/> -->
				</el-table>
				<!-- <el-pagination v-model:current-page="state.queryParams.page"
				v-model:page-size="state.queryParams.pageSize" :page-sizes="[10,20,30,40]"
				layout="->,total, sizes, prev, pager, next, jumper" :total="state.total"
				@size-change="handleSizeChange" @current-change="handleCurrentChange" :small="true" /> -->
			<!-- <template #footer>
				<span class="dialog-footer">
					<el-button @click="cancel">确认</el-button>
					
				</span>
			</template> -->
		</el-dialog>
	</div>
</template>

<script lang="ts" setup name="sysEditOrg">
import { onMounted, reactive, ref } from 'vue';

import { getAPI } from '/@/utils/axios-utils';

import {WmsApi} from '/@/api/wh';
const props = defineProps({
	title: String
});
const emits = defineEmits(['handleQuery']);
const ruleFormRef = ref();
const state = reactive({
	isShowDialog: false,
	ruleForm: {},
	materielWorkBins:[],
	queryParams: {
        page: 1,
        pageSize: 20
    },
	total:0
});

onMounted(async () => {

	
});
// const combine = computed(() => count.value + 1)
// 打开弹窗
const openDialog = async(row) => {
	// query(row.inAndOutBoundNum)
	WmsApi().PutAndOutdetail(row.inAndOutBoundNum)
	.then(function (res) {
		console.log(res);
	state.materielWorkBins = res.data.result.productData;
	state.isShowDialog = true;

})
	.catch(function (error) {
	console.log(error);

});
	state.isShowDialog=true;
};
const query=(a)=>{
	 WmsApi().PutAndOutdetail(a)
	.then(function (res) {
		console.log(res);
	state.materielWorkBins = res.data.result;
	state.isShowDialog = true;

})
	.catch(function (error) {
	console.log(error);

});

}
// 关闭弹窗
const closeDialog = () => {
	emits('handleQuery', true);
	state.isShowDialog = false;
};

// 取消
const cancel = () => {
	state.isShowDialog = false;
};
const handleSizeChange = (val: number) => {
		state.queryParams.pageSize = val;
	
	};
	const handleCurrentChange = (newVal: number) => {
		state.queryParams.page = newVal;
		
	};

// 提交


// 导出对象
defineExpose({ openDialog });
</script>
